import request from '@/utils/request'
import type { LoginForm, LoginResponseData, UserRespenseData } from './type'

enum API {
  LOGIN_URL = '/user/login',
  USERINFO_URL = '/user/info'
}

// 登录接口方法
export const reqLogin = (data: LoginForm) =>
  request.post<any, LoginResponseData>(API.LOGIN_URL, data)

// 获取用户信息
export const reqUserInfo = () => request.get<any, UserRespenseData>(API.USERINFO_URL)
